1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to video encoding and decoding, and more particularly to a video encoding and decoding in a temporal direct mode in a hierarchical structure.
2. Description of the Prior Art
With the development of information and communication technologies including the Internet, multimedia communications are increasing in addition to text and voice communications. The existing text-centered communication systems are insufficient to satisfy consumers' diverse desires, and thus multimedia services that can accommodate diverse forms of information such as text, images, and music are increasing. Since multimedia data is large, mass storage media and wide bandwidths are respectively required for storing and transmitting it. Accordingly, compression coding techniques are required to transmit the multimedia data.
The basic principle of data compression is to remove redundancy. Data can be compressed by removing spatial redundancy such as a repetition of the same color or object in images, temporal redundancy such as similar adjacent frames in moving images or continuous repetition of sounds, and visual/perceptual redundancy, which considers human insensitivity to high frequencies. In a general video coding method, the temporal redundancy is removed by temporal filtering based on motion compensation, and the spatial redundancy is removed by a spatial transform.
Diverse methods for reducing such redundancies have been proposed. The temporal direct mode (TDM) is useful for B-frames. In the TDM, motion vectors are predicted, in consideration of the correlation between a B-frame and a reference frame, using motion vectors of either of two frames (e.g., forward reference frame and backward reference frame) that the B-frame refers to.
FIG. 1 is a view explaining the TDM. In order to obtain motion vectors of the current B-frame 13, motion vectors MVF and MVB as expressed in Equation (1) are generated with reference to a motion vector MVD of a backward reference frame 14.
                                          MV            F                    =                                    TRp              TRb                        ×                          MV              D                                      ⁢                                  ⁢                                            MV              B                        =                                                            TRb                  -                  TRp                                TRb                            ×                              MV                D                            ×                              (                                  -                  1                                )                                              ,                                    (        1        )            
where TRb denotes the temporal distance between the forward and backward reference frames, and TRp denotes the temporal distance between the current B frame 12 and forward reference frame 11.
Since objects usually move in a uniform direction at a uniform speed, it is efficient to apply the TDM to the bidirectional B-frame. However, in the case of applying the TDM to a hierarchical B-frame, the efficiency may deteriorate when the distance between frames to be referred to is different from that between their left and right frames. Accordingly, a method and an apparatus are required which can apply a TDM to B-frames of a hierarchical structure in consideration of a picture order count (POC).